const mysql = require('promise-mysql2');
 
mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '842655',
    database: 'test'
}).then((conn) => {
    // do stuff with conn
    console.log('连接成功')
    conn.end();
}).catch((err) => {
    console.log(err)
})